<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php
	$edit		= JRequest::getVar('edit',true);
	$text = !$edit ? JText::_( 'Tạo mới' ) : JText::_( 'Sửa' );
	JToolBarHelper::title(   JText::_( 'Sản phẩm' ).': <small><small>[ ' . $text.' ]</small></small>' );
	JToolBarHelper::save();
	if (!$edit)  {
		JToolBarHelper::cancel('cancel', 'Hủy');
	} else {		
		JToolBarHelper::cancel( 'cancel', 'Thoát' );
	}	
	
?>
<script language="javascript" type="text/javascript">
	function submitbutton(pressbutton) {
		var form = document.adminForm;
		if (pressbutton == 'cancel') {
			submitform( pressbutton );
			return;
		}
		if (form.title.value == ""){
			alert( "<?php echo JText::_( 'Bạn hãy nhập tên', true ); ?>" );
		} else if (form.parent.value == ""){
			alert( "<?php echo JText::_( 'Bạn hãy chọn danh mục', true ); ?>" );
		}
		else {
			submitform( pressbutton );
		}
	}
</script>
<style type="text/css">
table.admintable td.key{width:150px;}
</style>
<form action="index.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
<?php 
echo $this->loadTemplate('default');
?>
<input type="hidden" name="oldimage" value="<?php echo $this->detail->image;?>" />
<input type="hidden" name="option" value="com_sanpham" />
<input type="hidden" name="saveColor" value="" />
<input type="hidden" name="product_id" value="<?php echo $this->detail->product_id; ?>" />
<input type="hidden" name="task" value="" />
</form>